﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SmartSapce.ServiceLocation;
using SmartSpace.OA;
using SmartSpace.Web;

namespace SmartSpace.WebApp.Modules.OA.Pages
{
    public partial class Article_View : SsTemplatePage
    {
        public Guid ArticleId { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            ArticleId = Request.GetGuid("id");

            IOAService oaService = ServiceLocator.Get<IOAService>();
            Article article = oaService.GetArticle(ArticleId);

            if (article != null)
            {
                _ctlTitle.InnerText = article.Title;

                _ctlDesc.InnerText = string.Format("{0} | {1}", article.Creator,article.CreatedDate);
                _ctlContent.Text = article.Content;
            }
        }
    }
}